import { defHttp } from "@/utils/http";
import { baseUrlApi } from './utils'

export type DetailResult = {
  code: number;
  data: any;
  msg: string;
};

/** 修改盘点单据备注 */
export const setStocktakingOrderUpdate = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/stocktakingPlan/update"),
    data
  });
};

/** 盘点登记 */
export const setStocktakingOrderRegistration = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/stocktakingPlan/registration"),
    data
  });
};

/** 库存盘点单列表带分页 */
export const setStocktakingOrderPageList = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/stocktakingPlan/pageList"),
    data
  });
};

/** 查看盘点明细 */
export const setStocktakingOrderDetail = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/stocktakingPlan/detail"),
    data
  });
};

/** 新增盘点 */
export const setStocktakingOrderAdd = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/stocktakingPlan/add"),
    data
  });
};

/** 盘点计划单号列表 */
export const getStocktakingOrderList = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/stocktakingPlan/list"),
    data
  });
};

/** 删除盘点计划 */
export const setStocktakingOrderDelete = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/stocktakingPlan/delete"),
    data
  });
};

/** 盘点计划范围列表 */
export const getStocktakingOrderRangePageList = (data?: object) => {
  return defHttp.post<DetailResult>({
    url: baseUrlApi("/stocktakingPlan/range/pageList"),
    data
  });
};
